package sg.edu.nus.iss.phoenix.schedule.dao;

import java.sql.SQLException;
import java.util.List;

import sg.edu.nus.iss.phoenix.schedule.entity.WeeklySchedule;

/**
 * WeeklySchedule Data Access Object. This class contains all database handling that is needed to 
 * implement CRUD operations for the WeeklySchedule Object.
 * @author Wang Shunde
 *	
 */
public interface WeeklyScheduleDAO {
	
	/***
	 * This method creates a weekly schedule record.
	 * 
	 * @param weeklySchedule
	 *            The {@link WeeklySchedule} to create.
	 * @return
	 *            The id of the created @{link WeeklySchedule}.
	 * @throws SQLException
	 */
	long createWeeklySchedule(WeeklySchedule weeklySchedule) throws SQLException;
	
	/***
	 * This method searches for weekly schedule records in an annual schedule.
	 * 
	 * @param selectedAnnualScheduleId
	 *            The id of the annual schedule to search.
	 * @return
	 *            A list of {@link WeeklySchedule} records.
	 * @throws SQLException
	 */
	List<WeeklySchedule> searchMatching(int selectedAnnualScheduleId) throws SQLException;
	
	/***
	 * This method searches for a weekly schedule record.
	 * @param annualScheduleId
	 *            The id of the annual schedule to search.
	 * @param weekNumber
	 *            The week number of the weekly schedule.
	 * @return
	 *            The {@link WeeklySchedule} found.
	 * @throws SQLException
	 */
	WeeklySchedule searchMatching(int annualScheduleId, int weekNumber) throws SQLException;
	
	/***
	 * This method updates a weekly schedule record.
	 * 
	 * @param ws
	 *            This parameter contains the data to update the record.
	 *            
	 * @throws SQLException
	 */
	void updateWeeklySchedule(WeeklySchedule ws) throws SQLException;
	
	/***
	 * This method deletes a weekly schedule record.
	 * 
	 * @param weeklyScheduleId
	 *            The id of the weekly schedule record to delete.
	 * @throws SQLException
	 */
	void deleteWeeklySchedule(long weeklyScheduleId) throws SQLException;
}
